/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Principal.java
 *
 * Created on Mar 17, 2010, 3:18:15 PM
 */

package edu.fca;

import edu.fca.ui.AlumnoUI;
import edu.fca.ui.CalendarioUI;
import edu.fca.ui.ProfesorUI;
import edu.fca.ui.tools.ComponentManager;

/**
 *
 * @author Romms
 */
public class Principal extends javax.swing.JFrame {

    /** Creates new form Principal */
    public Principal() {
        initComponents();
        ComponentManager.centerJFrame(this);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        appDesk = new javax.swing.JDesktopPane();
        jMenuBar1 = new javax.swing.JMenuBar();
        mnuMenu = new javax.swing.JMenu();
        mnuProfesor = new javax.swing.JMenuItem();
        mnuAlumno = new javax.swing.JMenuItem();
        mnuCalendario = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        addComponentListener(new java.awt.event.ComponentAdapter() {
            public void componentResized(java.awt.event.ComponentEvent evt) {
                formComponentResized(evt);
            }
        });
        addContainerListener(new java.awt.event.ContainerAdapter() {
            public void componentAdded(java.awt.event.ContainerEvent evt) {
                formComponentAdded(evt);
            }
        });

        mnuMenu.setText("Menu");
        mnuMenu.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuMenuActionPerformed(evt);
            }
        });

        mnuProfesor.setText("Profesor");
        mnuProfesor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuProfesorActionPerformed(evt);
            }
        });
        mnuMenu.add(mnuProfesor);

        mnuAlumno.setText("Alumno");
        mnuAlumno.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuAlumnoActionPerformed(evt);
            }
        });
        mnuMenu.add(mnuAlumno);

        mnuCalendario.setText("Calendario");
        mnuCalendario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuCalendarioActionPerformed(evt);
            }
        });
        mnuMenu.add(mnuCalendario);

        jMenuBar1.add(mnuMenu);

        jMenu2.setText("Alumno");
        jMenuBar1.add(jMenu2);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(appDesk, javax.swing.GroupLayout.DEFAULT_SIZE, 576, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(appDesk, javax.swing.GroupLayout.DEFAULT_SIZE, 383, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void mnuMenuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuMenuActionPerformed

    }//GEN-LAST:event_mnuMenuActionPerformed

    private void mnuProfesorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuProfesorActionPerformed
        ProfesorUI profesorUI = new ProfesorUI();
        appDesk.add(profesorUI);
        profesorUI.setVisible(true);
        appDesk.setSize(this.getSize().width,this.getSize().height);

    }//GEN-LAST:event_mnuProfesorActionPerformed

    private void mnuCalendarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuCalendarioActionPerformed
        CalendarioUI calendarioUI = new CalendarioUI();
        appDesk.add(calendarioUI);
        calendarioUI.setVisible(true);
    }//GEN-LAST:event_mnuCalendarioActionPerformed

    private void formComponentResized(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentResized
        appDesk.setSize(this.getSize().width,this.getSize().height);
    }//GEN-LAST:event_formComponentResized

    private void formComponentAdded(java.awt.event.ContainerEvent evt) {//GEN-FIRST:event_formComponentAdded

    }//GEN-LAST:event_formComponentAdded

    private void mnuAlumnoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuAlumnoActionPerformed
        AlumnoUI alumnoUI = new AlumnoUI();
        appDesk.add(alumnoUI);
        alumnoUI.setVisible(true);
        appDesk.setSize(this.getSize().width,this.getSize().height);
    }//GEN-LAST:event_mnuAlumnoActionPerformed



    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JDesktopPane appDesk;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem mnuAlumno;
    private javax.swing.JMenuItem mnuCalendario;
    private javax.swing.JMenu mnuMenu;
    private javax.swing.JMenuItem mnuProfesor;
    // End of variables declaration//GEN-END:variables

}
